#include <Windows.h>

#pragma once
class FrameRate
	{
	private:
		float         targetfps;
		float         fps;
		LARGE_INTEGER tickspersecond;
		LARGE_INTEGER currentticks;
		LARGE_INTEGER framedelay;

		float         speedfactor;	

		int loops;
		float media;
	public:
		FrameRate(float tfps);
		void SetSpeedFactor();
		float getSpeed(){return speedfactor < 3.f ? speedfactor : 3.f;}
		float getFPS( void ){return fps;}
		void update(){++loops;media += fps;}
		float getMedia(){media /= loops; loops = 1; return media;}
		~FrameRate();
	};
